package com.work.expection;

import com.work.enums.StatusCodeEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @Author: 星川
 * @Date: 2023/06/07/17:42
 * @Description:
 */

@Getter
@AllArgsConstructor
public class BizException extends RuntimeException{
    private Integer code ;
    private String message;


    public BizException(String message) {
        this.message = message;
    }

    public BizException(StatusCodeEnum statusCodeEnum) {
        this.code = statusCodeEnum.getCode();
        this.message = statusCodeEnum.getMsg();
    }

}
